/*
 * Block comments with details of changes
 */
public class MarketingExpensesDeleteHandler
{
    public static void comfirmDelete(List<MarketingExpenses__c> mes)
    {
        Set<Id> ms = new Set<Id>();
        for(MarketingExpenses__c m : mes){
        	ms.add(m.MarketingActivity__c);
        }
        ///Map<Id,String>mMap = new Map<Id,String>();
        for(Campaign c :[select Id,Status from Campaign where Id in: ms]){
        	//mMap.put(c.Id,c.Status);
            if(!(c.Status == '草案中' || c.Status == '预算审批已拒绝' || c.Status == '预算填写完毕')){
            	c.addError('市场活动的状态为"' +c.Status+'",不能删除!');
            }
        }
        
    }
}